<div><hr>
    <ul class="breadcrumb">
        <li><a href="#">分类</a> <span class="divider">|</span></li>
        <li><a href="#">添加</a></li>
    </ul>
    <hr>
</div>
<div class="row-fluid sortable">
    <div class="box span12">
        <div class="box-header" data-original-title>
            <h2><i class="icon-edit"></i><span class="break"></span>分类</h2>
            <div class="box-icon">
                <a href="#" class="btn-setting"><i class="icon-wrench"></i></a>
                <a href="#" class="btn-minimize"><i class="icon-chevron-up"></i></a>
                <a href="#" class="btn-close"><i class="icon-remove"></i></a>
            </div>
        </div>
        <div class="box-content">
            <form class="form-horizontal" action="<?php echo url('category/add'); ?>" method="post" id="addForm">
                <fieldset>
                    <div class="control-group">
                        <label class="control-label" for="typeahead">分类名称 </label>
                        <div class="controls">
                            <input type="text" class="required" name="cate[title]" value=""  />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="typeahead">上级分类 </label>
                        <div class="controls">
                            <?php echo fetch('categorySelect', array('name' => 'cate[parentID]', 'type' => $type, 'show' => '1')); ?>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="typeahead">分类排序 </label>
                        <div class="controls">
                            <input type="text" class="digits" name="cate[sortID]" value=""  />	

                        </div>
                    </div>
                    <div class="control-group hidden-phone">
                        <label class="control-label" for="textarea2">分类描述</label>
                        <div class="controls">   
							<input type="text" class="span6 typeahead" id="typeahead" name="cate[description]">
                        </div>
                    </div>
                    <div class="form-actions">
                        <input type="submit" value="添加"  id="submit" class="btn btn-primary" />
                    </div>
                </fieldset>
                <input type="hidden" name="type" value="<?php echo $type; ?>" />
            </form>   
        </div>
    </div><!--/span-->
</div><!--/row-->
<script type="text/javascript">
    $(document).ready(function(){
        $("#submit").click(function(){
            var cateType = "<?php echo $type; ?>";
            var url="";
            if(cateType=="<?php echo service_type::PRODUCT; ?>"||cateType=="<?php echo service_type::NEWS; ?>"){
                url = "<?php echo url('category?type=' . $type); ?>";
            }
            submitForm("#addForm",url);
        });
    });
</script>
